package Q1;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String str1 = scanner.nextLine();
        String str2 = scanner.nextLine();

        int len1 = str1.length();
        int len2 = str2.length();

        Map<Character, Boolean> map = new HashMap<>();
        
        for (int i = 0; i < len2; i++) {
            map.put(str2.charAt(i), true);
        }
        
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < len1; i++) {
            if (!map.containsKey(str1.charAt(i))) {
                stringBuilder.append(str1.charAt(i));
            }
        }

        System.out.println(stringBuilder.toString());
    }
}
